﻿#region MIT
/*
Engine Of Evermore (http://code.google.com/p/engineofevermore/)
Copyright (c) 2008, 2009 Michael Woerister

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EngineOfEvermore.Common;
using System.Drawing;
using System.Diagnostics;

namespace EngineOfEvermore.Imaging
{
    public interface IRenderer
    {
        IReadonlyCamera Camera { get; }
        ImageMap ImageMap { get; set; }
        Vector2d Scale { get; set; }
        float Rotation { get; set; }
        System.Drawing.Color Color { get; set; }
        bool FlipX { get; set; }
        bool FlipY { get; set; }

        /// <summary>
        /// Draws a frame of the current ImageMap with the current scale, rotation, color, and
        /// flip settings.
        /// </summary>
        /// <param name="frame">The frame to draw.</param>
        /// <param name="position">The center of the frame in world coordinates.</param>
        void DrawFrame( int frame, Vector2d position );

        /// <summary>
        /// Draws a frame of the current ImageMap with the current scale, rotation, color, and
        /// flip settings.
        /// </summary>
        /// <param name="frame">The frame to draw.</param>
        /// <param name="position">The center of the frame in world coordinates.</param>
        /// <param name="localClip">The visible portion of the frame in local coordinates.</param>
        /// <remarks>The localClip must be given in local coordinates where (0.0,0.0) is the upper
        /// left corner and (1.0, 1.0) is the lower right corner of the frame.</remarks>
        void DrawFrame( int frame, Vector2d position, RectangleF localClip );

        /// <summary>
        /// Draws a frame of the current ImageMap with the current color and flip settings into
        /// the given destination rectangle.
        /// </summary>
        /// <param name="frame">The frame to draw.</param>
        /// <param name="destRect">The destination rectangle in world coordinates.</param>
        /// <remarks>Scale and rotation are ignored.</remarks>
        void DrawFrame( int frame, RectangleF destRect );

        /// <summary>
        /// Draws a rectangle with the current color.
        /// </summary>
        /// <param name="rect">The rectangle in world coordinates.</param>
        void DrawRect( RectangleF rect );

        /// <summary>
        /// Draws a line with the current color.
        /// </summary>
        /// <param name="begin">The beginning point of the line in world coordinates.</param>
        /// <param name="end">The end point of the line in world coordinates.</param>
        void DrawLine( Vector2d begin, Vector2d end );

        /// <summary>
        /// Draws a line with the current color.
        /// </summary>
        /// <param name="center">The center of the circle in world coordinates.</param>
        /// <param name="radius">The radius of the circle.</param>
        void DrawCircle( Vector2d center, float radius );
    }

    
}
